import { createVNode, render } from 'vue'
import ZkModalConfirm from './index.vue'

export type OpenOptions = {
  title?: string
  tips?: string
  showConfirm?: boolean
  showCancel?: boolean
  confirmText?: string
  cancelText?: string
  confirmColor?: string
  confirm?: () => void
  cancel?: () => void
}
export type ZkModalConfirmInstance = {
  open(options?: OpenOptions): void
  close(): void
}

// 创建VNode
const VNode = createVNode(ZkModalConfirm)
// 挂载VNode
render(VNode, document.body)
const open = VNode.component?.exposed?.open
const close = VNode.component?.exposed?.close
export default { open, close }
